package com.huawei.zyb.taskManager.domain.task.valueobject;

/**
 * 任务优先级枚举值对象
 */
public enum TaskPriority {
    LOW("低", 1),
    MEDIUM("中", 2),
    HIGH("高", 3),
    URGENT("紧急", 4);

    private final String description;
    private final int level;

    TaskPriority(String description, int level) {
        this.description = description;
        this.level = level;
    }

    public String getDescription() {
        return description;
    }

    public int getLevel() {
        return level;
    }

    /**
     * 比较优先级高低
     */
    public boolean isHigherThan(TaskPriority other) {
        return this.level > other.level;
    }

    /**
     * 比较优先级高低
     */
    public boolean isLowerThan(TaskPriority other) {
        return this.level < other.level;
    }
}